function lst = remove_at(lst, index)
%REMOVE_AT Removes element(s) specified by index
%
% [ Syntax ]
%   - lst = remove_at(lst, index)
%
% [ Description ]
%   - lst = remove_at(lst, index) removes the elements specified by index.
%     The index can be a numeric vector or a logical vector.
%
% [ History ]
%   - Created by Dahua Lin, on Jan 5, 2008
%

c0 = capacity(lst);

lst.items(index) = [];
lst.n = lst.n - (c0 - capacity(lst));